import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class ChoseModelButton here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class ChoseModelButton extends Button
{
    String name;
    public ChoseModelButton(String _name)
    {
        super(_name);
        name = _name;
    }
    public void act()
    {
        if (Greenfoot.mouseClicked(this)) 
        {   
            switch(name)
            {
                case "单人模式":
                    Greenfoot.setWorld(new MyWorld());
                    break;
                case"双人模式":
                    Greenfoot.setWorld(new TwoPlayerWorld());
                    break;
                case"关卡模式":
                    Greenfoot.setWorld(new Level_Zero());
                    break;
                case"游戏介绍":
                    Greenfoot.setWorld(new GameInfo());
            }
            
        }

    }
}
